package fox.framework.rpc.server.message.response;

/**
 * @author cuichao
 * @Description: RpcServerResponseBuilder
 * @Date: create in 2021/2/17 15:54
 */
public class RpcServerResponseBuilder {


   /* private String protocol;

    private int status;

    private MappedRpcHeader header = new MappedRpcHeader();

    public void setProtocol(String protocol){
        this.protocol = protocol;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void  setHeader(String name, String value){
        header.setHeader(name,value);
    }

    public void setContentType(String type){
        header.setHeader(RpcHeader.CONTENT_TYPE,type);
    }

    public RpcServerResponse copyToRequest(RpcServerRequest request){
        RpcServerResponseAPI api = new RpcServerResponseAPI();
        api.setAttributes(request);
        api.setProtocol(request.getProtocol());
        return api;
    }

    public RpcServerResponse build(){
        RpcServerResponseAPI api = new RpcServerResponseAPI();
        api.setProtocol(protocol);
        api.setStatus(status);
        for (String name : header.getHeaderNames()) {
            api.setHeader(name,header.getHeader(name));
        }
        return api;
    }*/

}
